[fix](fe) Reject multi-column NGRAM_BF indexes#64343
Conversation
### What problem does this PR solve?
Issue Number: DORIS-19296
Problem Summary: Creating an NGRAM_BF index with multiple columns passed FE validation and could reach BE tablet creation, where tablet metadata expects each NGRAM_BF index to bind exactly one column. This rejects invalid DDL during FE analysis for both inline table indexes and CREATE INDEX.
### Release note
Reject invalid multi-column NGRAM_BF index definitions during DDL analysis.
### Check List (For Author)
- Test: Unit Test / Build
- ./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.IndexDefinitionTest
- ./build.sh --fe
- Added regression coverage under index_p0; not run locally because no worktree Doris cluster was started.
- Behavior changed: Yes. Invalid multi-column NGRAM_BF index definitions now fail in FE analysis.
- Does this need documentation: No
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 29324 ms |
TPC-DS: Total hot run time: 169439 ms |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
TPC-H: Total hot run time: 29625 ms |
FE UT Coverage ReportIncrement line coverage |
TPC-DS: Total hot run time: 169362 ms |
TPC-H: Total hot run time: 29258 ms |
TPC-DS: Total hot run time: 168815 ms |
FE Regression Coverage ReportIncrement line coverage |
|
/review |
There was a problem hiding this comment.
Review result: no blocking issues found.
Critical checkpoint conclusions:
- Goal and proof: The PR rejects multi-column NGRAM_BF definitions in
IndexDefinition.validate(), which is reached by inline table indexes,ALTER TABLE ADD INDEX, and standaloneCREATE INDEX. The new unit and regression cases cover the invalid multi-column DDLs, and the build-index unit case covers the deferred path where columns are intentionally absent. - Scope: The code change is small and focused on the existing single-column validation branch, with no unrelated behavior changes.
- Concurrency/lifecycle: No new concurrency is introduced. The non-intuitive lifecycle is the deferred
BUILD INDEXconstructor withcols == null; the added early return for NGRAM_BF preserves that path. - Config/compatibility/protocol: No new configuration, storage format, or FE-BE protocol fields are added.
- Parallel paths: Nereids parser paths for inline indexes, alter add index, and create index all construct the same
IndexDefinition; build index is handled separately by the deferred branch. - Conditional checks: The new condition aligns NGRAM_BF with existing single-column index types while exempting deferred build validation.
- Tests/results: Added FE unit coverage and regression negative cases. No
.outupdate is needed because the regression additions are exception-only. - Observability, transaction/persistence, performance: Not applicable for this validation-only change; no issue found.
- User focus: No additional review focus was provided.
I attempted to run ./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.IndexDefinitionTest, but the runner failed during generated-code setup before executing tests because thirdparty/installed/bin/protoc is missing.
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
What problem does this PR solve?
Related PR: None
Problem Summary:
Creating an NGRAM_BF index with multiple columns passed FE validation and could reach BE tablet creation, where tablet metadata expects each NGRAM_BF index to bind exactly one column. This rejects invalid multi-column NGRAM_BF definitions during FE analysis for both inline table indexes and CREATE INDEX.
Release note
Reject invalid multi-column NGRAM_BF index definitions during DDL analysis.
Check List (For Author)
Test
regression-test/suites/index_p0/test_ngram_bloomfilter_index.groovyfor inline table index and CREATE INDEX paths. Not run locally because no worktree Doris cluster was started../run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.IndexDefinitionTest./build.sh --feBehavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)